$(function () {
    var error_phone = false
    var error_num = false

    $('#phone').blur(function () {
        phone_check();
    });
    $('#check_num').blur(function () {
        num_check();
    });

    function phone_check() {
        var re = /^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/;
        if (re.test($('#phone').val())){
            console.log(1231)
            $('#phone').next().hide();
            error_phone = false;
        }
        else
        {
            $('#phone').next().html('手机号格式不正')
            $('#phone').next().show();
            error_phone= true;
        }

    }

    function num_check() {
        var len=$('#check_num').val().length;
        if (len != 6){
            $('#check_num').next().html('请填写正确的验证码')
            $('#check_num').next().show()
            error_num = true

        }
        else
        {
            $('#check_num').next().hide()
            error_num = false
        }

    }


})